package cn.kopsoft.basic.service.impl;

import java.util.List;
import cn.kopsoft.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.kopsoft.basic.mapper.BasicCompanyMapper;
import cn.kopsoft.basic.domain.BasicCompany;
import cn.kopsoft.basic.service.IBasicCompanyService;

/**
 * 公司信息Service业务层处理
 * 
 * @author kopsoftPlatform
 * @date 2025-03-23
 */
@Service
public class BasicCompanyServiceImpl implements IBasicCompanyService 
{
    @Autowired
    private BasicCompanyMapper basicCompanyMapper;

    /**
     * 查询公司信息
     * 
     * @param id 公司信息主键
     * @return 公司信息
     */
    @Override
    public BasicCompany selectBasicCompanyById(String id)
    {
        return basicCompanyMapper.selectBasicCompanyById(id);
    }

    /**
     * 查询公司信息列表
     * 
     * @param basicCompany 公司信息
     * @return 公司信息
     */
    @Override
    public List<BasicCompany> selectBasicCompanyList(BasicCompany basicCompany)
    {
        return basicCompanyMapper.selectBasicCompanyList(basicCompany);
    }

    /**
     * 新增公司信息
     * 
     * @param basicCompany 公司信息
     * @return 结果
     */
    @Override
    public int insertBasicCompany(BasicCompany basicCompany)
    {
        basicCompany.setCreateTime(DateUtils.getNowDate());
        return basicCompanyMapper.insertBasicCompany(basicCompany);
    }

    /**
     * 修改公司信息
     * 
     * @param basicCompany 公司信息
     * @return 结果
     */
    @Override
    public int updateBasicCompany(BasicCompany basicCompany)
    {
        basicCompany.setUpdateTime(DateUtils.getNowDate());
        return basicCompanyMapper.updateBasicCompany(basicCompany);
    }

    /**
     * 批量删除公司信息
     * 
     * @param ids 需要删除的公司信息主键
     * @return 结果
     */
    @Override
    public int deleteBasicCompanyByIds(String[] ids)
    {
        return basicCompanyMapper.deleteBasicCompanyByIds(ids);
    }

    /**
     * 删除公司信息信息
     * 
     * @param id 公司信息主键
     * @return 结果
     */
    @Override
    public int deleteBasicCompanyById(String id)
    {
        return basicCompanyMapper.deleteBasicCompanyById(id);
    }
}
